<?php

if (!defined('BASEPATH'))
	exit('No direct script access allowed');

class module extends My_Controller {

	public function load($module_name = '', $task = '') {
		if (!$module_name || !$task) 
		die;
		$this->load->helper('module');
		try {
			$module_name .= '_module';
			$this->load->model('modules/'.$module_name);
			$task .= 'Action';
			$segments = $this->uri->rsegment_array();
			for ($i=0; $i<4; $i++) array_shift($segments);
			$this->$module_name->$task($segments);
			
		}catch (Exception $e){
			echo $module_name . " not found 404";
		}
	}

}
